<%@ page  pageEncoding= "utf-8" %>
<%
	//
	//    Author:mouhb
	//    作用：利用queryResult进行分页，在不能使用display标签的时候还能使用queryResult；
	//    使用方法：向你要进行分页的页面传递一个queryResult，用queryResultName.list获取集合再使用
	//    c:forEach显示。然后<c:set var='queryResult' value='${queryResultName}' scope="page"/>
	//    queryResultName需要换成你传到页面的时候的对象key
	//    再用include指令 include file="${ctxPath}/common/queryReslut_Paging.jsp"
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:if test="${empty queryResult}">
	<c:out value="请先将你要使用的queryResult进行c:set！格式如：<c:set var='queryResult' value='EL表达式' scope='page'/>"></c:out>
</c:if>
<c:if test="${(not empty queryResult) and queryResult.fullListSize>0}" >
	<div id="pageLink" class="pageLink">
		第${queryResult.pageNumber}/${queryResult.totalPages}页，共${queryResult.fullListSize}条记录，
		每页<select id="pageSize" name="pageSize" onchange="changePageSize(this);">
				<option value="2" <c:if test="${queryResult.objectsPerPage==2}">selected</c:if>>2</option>
				<option value="10" <c:if test="${queryResult.objectsPerPage==10}">selected</c:if>>10</option>
				<option value="12" <c:if test="${queryResult.objectsPerPage==12}">selected</c:if>>12</option>
				<option value="20" <c:if test="${queryResult.objectsPerPage==20}">selected</c:if>>20</option>
				<option value="50" <c:if test="${queryResult.objectsPerPage==50}">selected</c:if>>50</option>
			</select>条记录。
		<a href="#" onclick="first()">首&nbsp;页</a><span id="pageNavSpace" />
		<a href="#" onclick="previous();">上一页</a>
		<c:forEach items="${queryResult.pageArr}" step="1" var="i">
			<c:choose>
				<c:when test="${i==queryResult.pageNumber}">
					<font class="pageLinkOn">${i}</font>
				</c:when>
				<c:otherwise>
					<a href="#" onclick="goPage(${i})">${i}</a>
				</c:otherwise>
			</c:choose>
		</c:forEach>
		<span id="pageNavSpace" /><a href="#" onclick="next()">下一页</a>
		<span id="pageNavSpace" /><a href="#" onclick="last()">尾&nbsp;页</a>
		转至第<input type="text" id="navNum" name="navNum" size="1" value="${queryResult.pageNumber}" class="navPapeNum"/>页
		<span id="pageNavSpace" />&nbsp;<input type="button" id="btnGo" value="跳转" size="4" class="btn2" style="height:23px;" onclick="jumpTo();">
		<input type="hidden" id="pageNum" name="pageNum" value="${queryResult.pageNumber}" />
		<input type="hidden" id="totalPages" name="totalPages" value="${queryResult.totalPages}"/>
		<a id="_nav" href="" style="display:none"></a>
		<script type="text/javascript">
			var baseUrl= window.location.href;
			var url = baseUrl.substring(baseUrl.lastIndexOf('/')+1);
			$("#_nav").attr("href",url);
		</script>
	</div>
</c:if>